package com.itlong.cloud.paymenthub;

import com.itlong.cloud.POJO.DTO.operate.OperateShareProfitRuleDTO;
import com.itlong.cloud.POJO.VO.operate.OperateShareProfitRuleGetVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <desc>
 *      分润规则信息管理接口暴露
 * </desc>
 *
 * @createDate 2019/05/20
 */
@FeignClient(name = "payment-hub-service")
public interface IOperateShareProfitRuleServiceClient {

    /**
     * <desc>
     *      分页获取分润规则信息
     * </desc>
     *
     * @param operateShareProfitRuleDTO 分润规则信息DTO
     * @return 分润规则信息列表
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/getPage")
    Page<OperateShareProfitRuleGetVO> getPage(@RequestBody OperateShareProfitRuleDTO operateShareProfitRuleDTO) throws Exception;

    /**
     * <desc>
     *      添加分润规则信息
     * </desc>
     *
     * @param operateShareProfitRuleDTO 分润规则信息DTO
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/save")
    Integer save(@RequestBody OperateShareProfitRuleDTO operateShareProfitRuleDTO) throws Exception;

    /**
     * <desc>
     *      查询单个分润规则
     * </desc>
     *
     * @param operateShareProfitRuleDTO 分润规则信息DTO
     * @return 分润规则
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/getOne")
    OperateShareProfitRuleGetVO getOne(@RequestBody OperateShareProfitRuleDTO operateShareProfitRuleDTO) throws Exception;

    /**
     * <desc>
     *      修改分润规则信息
     * </desc>
     *
     * @param operateShareProfitRuleDTO 分润规则信息DTO
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/update")
    Integer update(@RequestBody OperateShareProfitRuleDTO operateShareProfitRuleDTO) throws Exception;

    /**
     * <desc>
     *      删除分润规则信息，可批量
     * </desc>
     *
     * @param ruleIds 分润规则信息id，多个英文逗号相连
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/delete")
    Integer delete(@RequestParam("ruleIds") String ruleIds) throws Exception;

    /**
     * <desc>
     *      校验分润规则是否闲置
     * </desc>
     *
     * @param ruleIds 分润规则信息id，多个英文逗号相连
     * @return true-是，false-否
     * @author wangzhi
     * @createDate 2019/05/20
     */
    @PostMapping("/operate/shareProfitRule/checkRuleIdle")
    boolean checkRuleIdle(@RequestParam("ruleIds") String ruleIds) throws Exception;
}
